Integrand size = 21, antiderivative size = 101 \[ \int \cos (e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\frac {\operatorname {AppellF1}\left (\frac {1}{2},p,-p,\frac {3}{2},\sin ^2(e+f x),\frac {a \sin ^2(e+f x)}{a+b}\right ) \cos ^2(e+f x)^p \sin (e+f x) \left (\sec ^2(e+f x) \left (a+b-a \sin ^2(e+f x)\right )\right )^p \left (1-\frac {a \sin ^2(e+f x)}{a+b}\right )^{-p}}{f} \]
[Out]
Time = 0.11 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {4233, 1985, 1986, 441, 440} \[ \int \cos (e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\frac {\sin (e+f x) \cos ^2(e+f x)^p \left (1-\frac {a \sin ^2(e+f x)}{a+b}\right )^{-p} \operatorname {AppellF1}\left (\frac {1}{2},p,-p,\frac {3}{2},\sin ^2(e+f x),\frac {a \sin ^2(e+f x)}{a+b}\right ) \left (\sec ^2(e+f x) \left (-a \sin ^2(e+f x)+a+b\right )\right )^p}{f} \]
[In]
[Out]
Rule 440
Rule 441
Rule 1985
Rule 1986
Rule 4233
Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \left (a+\frac {b}{1-x^2}\right )^p \, dx,x,\sin (e+f x)\right )}{f} \\ & = \frac {\text {Subst}\left (\int \left (\frac {a+b-a x^2}{1-x^2}\right )^p \, dx,x,\sin (e+f x)\right )}{f} \\ & = \frac {\left (\cos ^2(e+f x)^p \left (a+b-a \sin ^2(e+f x)\right )^{-p} \left (\sec ^2(e+f x) \left (a+b-a \sin ^2(e+f x)\right )\right )^p\right ) \text {Subst}\left (\int \left (1-x^2\right )^{-p} \left (a+b-a x^2\right )^p \, dx,x,\sin (e+f x)\right )}{f} \\ & = \frac {\left (\cos ^2(e+f x)^p \left (\sec ^2(e+f x) \left (a+b-a \sin ^2(e+f x)\right )\right )^p \left (1-\frac {a \sin ^2(e+f x)}{a+b}\right )^{-p}\right ) \text {Subst}\left (\int \left (1-x^2\right )^{-p} \left (1-\frac {a x^2}{a+b}\right )^p \, dx,x,\sin (e+f x)\right )}{f} \\ & = \frac {\operatorname {AppellF1}\left (\frac {1}{2},p,-p,\frac {3}{2},\sin ^2(e+f x),\frac {a \sin ^2(e+f x)}{a+b}\right ) \cos ^2(e+f x)^p \sin (e+f x) \left (\sec ^2(e+f x) \left (a+b-a \sin ^2(e+f x)\right )\right )^p \left (1-\frac {a \sin ^2(e+f x)}{a+b}\right )^{-p}}{f} \\ \end{align*}
Leaf count is larger than twice the leaf count of optimal. \(1983\) vs. \(2(101)=202\).
Time = 17.08 (sec) , antiderivative size = 1983, normalized size of antiderivative = 19.63 \[ \int \cos (e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=-\frac {3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},\frac {3}{2},-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) (a+2 b+a \cos (2 (e+f x)))^p \sec ^2(e+f x)^{-\frac {3}{2}+p} \left (a+b \sec ^2(e+f x)\right )^p \sin (e+f x)}{f \left (-3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},\frac {3}{2},-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+\left (-2 b p \operatorname {AppellF1}\left (\frac {3}{2},\frac {3}{2},1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+3 (a+b) \operatorname {AppellF1}\left (\frac {3}{2},\frac {5}{2},-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )\right ) \tan ^2(e+f x)\right ) \left (-\frac {3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},\frac {3}{2},-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) (a+2 b+a \cos (2 (e+f x)))^p \sec ^2(e+f x)^{-\frac {1}{2}+p}}{-3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},\frac {3}{2},-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+\left (-2 b p \operatorname {AppellF1}\left (\frac {3}{2},\frac {3}{2},1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+3 (a+b) \operatorname {AppellF1}\left (\frac {3}{2},\frac {5}{2},-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )\right ) \tan ^2(e+f x)}+\frac {6 a (a+b) p \operatorname {AppellF1}\left (\frac {1}{2},\frac {3}{2},-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) (a+2 b+a \cos (2 (e+f x)))^{-1+p} \sec ^2(e+f x)^{-\frac {3}{2}+p} \sin (2 (e+f x)) \tan (e+f x)}{-3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},\frac {3}{2},-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+\left (-2 b p \operatorname {AppellF1}\left (\frac {3}{2},\frac {3}{2},1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+3 (a+b) \operatorname {AppellF1}\left (\frac {3}{2},\frac {5}{2},-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )\right ) \tan ^2(e+f x)}-\frac {6 (a+b) \left (-\frac {3}{2}+p\right ) \operatorname {AppellF1}\left (\frac {1}{2},\frac {3}{2},-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) (a+2 b+a \cos (2 (e+f x)))^p \sec ^2(e+f x)^{-\frac {3}{2}+p} \tan ^2(e+f x)}{-3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},\frac {3}{2},-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+\left (-2 b p \operatorname {AppellF1}\left (\frac {3}{2},\frac {3}{2},1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+3 (a+b) \operatorname {AppellF1}\left (\frac {3}{2},\frac {5}{2},-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )\right ) \tan ^2(e+f x)}-\frac {3 (a+b) (a+2 b+a \cos (2 (e+f x)))^p \sec ^2(e+f x)^{-\frac {3}{2}+p} \tan (e+f x) \left (\frac {2 b p \operatorname {AppellF1}\left (\frac {3}{2},\frac {3}{2},1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \sec ^2(e+f x) \tan (e+f x)}{3 (a+b)}-\operatorname {AppellF1}\left (\frac {3}{2},\frac {5}{2},-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \sec ^2(e+f x) \tan (e+f x)\right )}{-3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},\frac {3}{2},-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+\left (-2 b p \operatorname {AppellF1}\left (\frac {3}{2},\frac {3}{2},1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+3 (a+b) \operatorname {AppellF1}\left (\frac {3}{2},\frac {5}{2},-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )\right ) \tan ^2(e+f x)}+\frac {3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},\frac {3}{2},-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) (a+2 b+a \cos (2 (e+f x)))^p \sec ^2(e+f x)^{-\frac {3}{2}+p} \tan (e+f x) \left (2 \left (-2 b p \operatorname {AppellF1}\left (\frac {3}{2},\frac {3}{2},1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+3 (a+b) \operatorname {AppellF1}\left (\frac {3}{2},\frac {5}{2},-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )\right ) \sec ^2(e+f x) \tan (e+f x)-3 (a+b) \left (\frac {2 b p \operatorname {AppellF1}\left (\frac {3}{2},\frac {3}{2},1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \sec ^2(e+f x) \tan (e+f x)}{3 (a+b)}-\operatorname {AppellF1}\left (\frac {3}{2},\frac {5}{2},-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \sec ^2(e+f x) \tan (e+f x)\right )+\tan ^2(e+f x) \left (-2 b p \left (-\frac {6 b (1-p) \operatorname {AppellF1}\left (\frac {5}{2},\frac {3}{2},2-p,\frac {7}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \sec ^2(e+f x) \tan (e+f x)}{5 (a+b)}-\frac {9}{5} \operatorname {AppellF1}\left (\frac {5}{2},\frac {5}{2},1-p,\frac {7}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \sec ^2(e+f x) \tan (e+f x)\right )+3 (a+b) \left (\frac {6 b p \operatorname {AppellF1}\left (\frac {5}{2},\frac {5}{2},1-p,\frac {7}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \sec ^2(e+f x) \tan (e+f x)}{5 (a+b)}-3 \operatorname {AppellF1}\left (\frac {5}{2},\frac {7}{2},-p,\frac {7}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \sec ^2(e+f x) \tan (e+f x)\right )\right )\right )}{\left (-3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},\frac {3}{2},-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+\left (-2 b p \operatorname {AppellF1}\left (\frac {3}{2},\frac {3}{2},1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+3 (a+b) \operatorname {AppellF1}\left (\frac {3}{2},\frac {5}{2},-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )\right ) \tan ^2(e+f x)\right )^2}\right )} \]
[In]
[Out]
\[\int \cos \left (f x +e \right ) \left (a +b \sec \left (f x +e \right )^{2}\right )^{p}d x\]
[In]
[Out]
\[ \int \cos (e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\int { {\left (b \sec \left (f x + e\right )^{2} + a\right )}^{p} \cos \left (f x + e\right ) \,d x } \]
[In]
[Out]
\[ \int \cos (e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\int \left (a + b \sec ^{2}{\left (e + f x \right )}\right )^{p} \cos {\left (e + f x \right )}\, dx \]
[In]
[Out]
\[ \int \cos (e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\int { {\left (b \sec \left (f x + e\right )^{2} + a\right )}^{p} \cos \left (f x + e\right ) \,d x } \]
[In]
[Out]
\[ \int \cos (e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\int { {\left (b \sec \left (f x + e\right )^{2} + a\right )}^{p} \cos \left (f x + e\right ) \,d x } \]
[In]
[Out]
Timed out. \[ \int \cos (e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\int \cos \left (e+f\,x\right )\,{\left (a+\frac {b}{{\cos \left (e+f\,x\right )}^2}\right )}^p \,d x \]
[In]
[Out]